﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.IO;

namespace workflowMVC.Controllers
{
    public class UtilController : Controller
    {
        public ActionResult UpLoadImgBox()
        {
            return View();
        }

        [HttpPost]
        public ActionResult UpLoadImg(HttpPostedFileBase upload, string det)
        {
            Guid id = System.Guid.NewGuid();

            var filename = Path.GetFileName(upload.FileName);
            String resulturl = ("~/Content/Images/") + id + "_" + filename;
            ViewData["url"] = resulturl;
            upload.SaveAs(Server.MapPath(@"~\Content\Images\") + id + "_" + filename);
            return View();
        }

    }
}
